-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: refactor kvpair, add tests #1057
Conversation
wolkykim
commented
Aug 17, 2023
- simplify Less() and remove the unnecessary panic check
- add comments
- add tests
Hi @wolkykim, thanks for your contribution, the newly introduced comments and the tests that you've provided. The team will review this asap. If you haven't yet, check out the Game of Realms to understand more about the contribution campaign we are running and be sure to register in order to be eligible for rewards. |
@waymobetta Hi, that's great to know. What is |
Example: This is the public address of the wallet you've created. We collect this and associate it with your Github username in order to distribute Game of Realms rewards based on your contributions to the various Gno repositories. |
@wolkykim Thank you for the contribution. The testing cases and correction on comments are good! However we are in favor of switch then if-else for Less() implementation due to following reasons.
|
@piux2 Hi, I'm also fine with using switch in general. Just that in this particular case it has a default that will never be reached, and then this line doesn't apply the same practice. Just so you know where this started. Would you like this PR closed or a revised commit that rolls back the Less() to the original logic? |
Thank for pointing it out. It's good practice to include a default case even if it seems unreachable. This serves as a safety precaution. The second comparison directly returns results to the caller, which is a different scenario than the first comparison in the switch
@wolkykim can you roll back the Less() to the original implementation. Let's keep the test and comments. Again, thank you for the contribution! |
@piux2 I've updated it. The original Less() logics are back to life! |